﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;

namespace SMS_API_SENDER
{
    public class CommandObjectFactory
    {
        public static List<CommandObject> Create(XmlNodeList commandNode)
        {
            List<CommandObject> commandList = new List<CommandObject>();
            foreach (XmlNode node in commandNode)
            {
                CommandObject commandObject = new CommandObject();
                commandObject.Title = node.SelectSingleNode("Title").InnerText;
                commandObject.Command = node.SelectSingleNode("Command").InnerText;
                commandObject.Description = node.SelectSingleNode("Description").InnerText;
                commandList.Add(commandObject);
            }
            return commandList;
        }
    }
}